package main

import (
	"fmt"
	"time"
)

func main() {
	fownLoad(func(progress int) {
		fmt.Println("当前下载的速度:", progress)
	})
}

func fownLoad(output func(progress int)) {
	value := 0
	for {
		output(value)
		value++
		if value > 100 {
			break
		}
		time.Sleep(1 * time.Second)
	}
}
